package com.wzy.portfolio.controller;

import com.wzy.portfolio.model.*;
import com.wzy.portfolio.service.StockService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name = "股票分析", description = "股票分析")
@RestController
@RequestMapping("/stock")
public class StockParseController {

    @Autowired
    StockService stockService;

    @GetMapping("/parse/reportInfo")
    @Operation(summary = "获取财报信息", description = "获取财报信息")
    public void getReportInfo(@RequestParam ("reportDate") String reportDate){
        stockService.reportInfo(reportDate);
    }

    @PostMapping("/parse/updateMaxNewPrice")
    @Operation(summary = "更新股票最高最新价", description = "跟新股票最高最新价")
    public void updateStockMaxNewPrice(){
        stockService.updateStockMaxNewPrice();
    }

    @PostMapping("/history/price")
    @Operation(summary = "东财网股票历史数据", description = "东财网股票历史数据")
    public String dcwHistoryPrice(@RequestBody StockHistoryReq req){
        return stockService.dcwHistoryPrice(req);
    }

}
